Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check window functions by str for with_column #12431

Merged
merged 5 commits into from
Sep 11, 2024

Conversation

timsaucer
Copy link
Contributor

Which issue does this PR close?

Closes #12425

Rationale for this change

The current implementation regresses when you have multiple columns without a qualifier and the new with_column is a window function. This is because the loop is checking for any field to not have a qualifier.

What changes are included in this PR?

Check the display name of the expr in the schema matches that of the window function that was added.

Are these changes tested?

Updated unit test

Are there any user-facing changes?

None

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code ane test makes sense to me. Thank you @timsaucer

datafusion/core/src/dataframe/mod.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @timsaucer

@comphead comphead merged commit 13dc8a6 into apache:main Sep 11, 2024
24 checks passed
@timsaucer timsaucer deleted the tsaucer/with_column_window_fix branch October 10, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling with_column twice generates an error when the second call uses a window function
4 participants